package com.haiertvbic.tvwa;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;

import com.haiertvbic.tvwa.model.FavChannelBean;
import com.haiertvbic.tvwa.model.FavChannelPagekage;
import com.haiertvbic.tvwa.model.LocalCodeBean;
import com.haiertvbic.tvwa.protocol.CAEProtocol;
import com.haiertvbic.tvwa.util.SLog;

public class TestActivity extends Activity {
private static final String TAG = "FavoriteChannelActivity";

@Override
protected void onCreate(Bundle savedInstanceState) {
			
	// TODO Auto-generated method stub
	new Thread(){
		@Override
		public void run() {
			//测试本地信息
//			LocalCodeBean oo = CAEProtocol.getLocalCode();
//			SLog.d(TAG, "State"+oo.getState());
//			SLog.d(TAG, "Province"+oo.getProvince());
//			SLog.d(TAG, "City"+oo.getCity());
//			SLog.d(TAG, "Street"+oo.getStreet());
			//测试节目获取
			FavChannelPagekage favcha =CAEProtocol.getFavChannel(1, 5);
			if (favcha != null) {
				ArrayList<FavChannelBean> chas = 	favcha.getChannels();
				for (int i = 0; i < chas.size(); i++) {
					SLog.d(TAG, "获取前五个频道号为："+chas.get(i).getChannel_id());
				}
			}
//			
//			测试节目分类
//			ArrayList<ProgramItemBean> ii = null;
//			try {
//				ii = EPGWeb.getProgramItem();
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
//			System.out.println("执行到：ArrayList<ProgramItemBean> ii = EPGWeb.getProgramItem();拉");
//			System.out.println("ii的长度："+ii.size());
//			for (int j = 0; j < ii.size(); j++) {
//				System.out.println("=====================*************节点："+ii.get(j).getNode());
//				System.out.println("=====================*************分类名字："+ii.get(j).getName());
//				System.out.println("=====================*************根节点:"+ii.get(j).getPnode());
//				
//			}
//			
//			// TODO Auto-generated method stub
//			ArrayList<ProgramBean> temp = null;
//			try {
//				temp = EPGWeb.getProgramList(FavoriteChannelActivity.this,4);
//			} catch (Exception e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//			if (temp==null) {
//				System.out.println("我为空了");
//			}
//			System.out.println("ProgramBean节目我的长度："+temp.size());
//			for (int i = 0; i < temp.size(); i++) {
//				System.out.println("=====================*************开始播放时间"+temp.get(i).getPstime());
//				System.out.println("=====================*************节目类型"+temp.get(i).getPtype());
//				System.out.println("=====================*************");
//			}
			super.run();
		}
		
		
		
	}.start();
	super.onCreate(savedInstanceState);
}
}
